package cn.dnui_cr503.dnuifood_16110100503.model;

import cn.dnui_cr503.dnuifood_16110100503.iface.Shopiface;
import cn.dnui_cr503.dnuifood_16110100503.listener.OnRetrofitListener;
import cn.dnui_cr503.dnuifood_16110100503.service.ShopService;
import retrofit2.Call;

/**
 * Created by chengrui on 2018/10/31.
 */

public class ShopModel extends BaseModel implements Shopiface{

    private ShopService service;
    public ShopModel(){
        super();
        service = retrofit.create(ShopService.class);
    }
    @Override
    public void getAllShops(OnRetrofitListener listener) {
        Call call =service.getAllShops();
        bindCallback(call,listener,1);
    }

    @Override
    public void isCollected(int user_id, int shop_food_id, int flag, OnRetrofitListener listener) {
        Call call =service.isCollected(user_id,shop_food_id,flag);
        bindCallback(call,listener, 2);
    }


}
